<?php
$page = (intval($this->uri->segment(4)));
if ($page <= 1)
    $page = 0;
else
    $page = ($page - 1) * PAGE_SIZE
    ?>
<?= anchor($uri = 'admincp/admin_category/add_news', $title = 'Thêm tin tức mới', $attributes = array('class' => 'add')) ?>
<div style="float:left; width: 100%">
    <table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">
        <tbody>
            <tr >

                <th class="table-header-repeat line-left minwidth-1" ><a >#</a>	</th>
                <th class="table-header-repeat line-left minwidth-1"><a >Tiêu đề</a></th>
                <th class="table-header-repeat line-left"><a >Ngày đăng</a></th>
                <th class="table-header-repeat line-left"><a >Nội dung ngắn</a></th>
                <th class="table-header-repeat line-left"><a >Nội dung</a></th>
                <th class="table-header-repeat line-left"><a >Người đăng</a></th>
                <th class="table-header-repeat line-left"><a >Nguồn</a></th>
                <th class="table-header-options line-left"><a >Thao tác</a></th>
            </tr>
            <?php //if (isset($list)) { ?>

            <?php
            $i = 0;
            foreach ($list as $row):
                ?>

                <tr  style="text-transform: uppercase" <?= ($i % 2) ? 'class="alternate-row"' : '' ?>  >

                    <td ><?= $i + $page + 1 ?></td>
                    <td> <a href="<?= HOME_PAGE . ADMIN_PAGE ?>admin_news/update_news/<?= $row->news_id ?>"> <?= $row->news_title ?></a></td>
                    <td><?= $row->news_date?></td>
                    <td><?= $row->news_short_content?></td>
                    <td><?= $row->news_content ?></td>
                     <td><?= $row->news_author?></td>
                    <td><?= $row->news_source ?></td>
                    <td class="options-width">
                        <a href="<?= HOME_PAGE . ADMIN_PAGE ?>admin_news/update_news/<?= $row->news_id ?>" class="icon-1 info-tooltip" title="Cập nhật"></a>
                        <a href="<?= HOME_PAGE . ADMIN_PAGE ?>admin_news/delete_news/<?= $row->news_id ?>" onclick="return confirm('Bạn muốn xóa?');" class="icon-2 info-tooltip" title="Xóa"></a>
                        <!--                    <a href="" class="icon-3 info-tooltip" title="Thêm ảnh"></a>-->
                    </td>
                </tr>
                <?php
                $i++;
            endforeach;
            ?>

            <?php // } ?>

        </tbody></table>
    <!--  end product-table................................... --> 

    <table border="0" cellpadding="0" cellspacing="0" >
        <tbody><tr>
                <td>
                    <div class="paging">
                        <?= $this->pagination->create_links(); ?>
                    </div>
                </td>

            </tr>
        </tbody></table>
</div>